set RECV_LISTEN(475) m_needpass

proc m_needpass {raw chid parent me} {
	regexp {:[^ ]+ 475 [^ ]+ ([^ ]+) :.+} $raw -> channel
	toplevel .key
	ttk::label .key.label -text "[tr Channel] $channel [tr {requires a password. Please enter it}]"
	
	ttk::frame .key.botbox
	ttk::entry .key.botbox.passwd -show "*"
	ttk::button .key.botbox.btn -command "set done 1" -text [tr "Rejoin"]
	
	pack .key.label
	pack .key.botbox
	pack .key.botbox.passwd -side left
	pack .key.botbox.btn -side right
	vwait done
	
	raw $chid "JOIN $channel [.key.botbox.passwd get]"
	
	destroy .key.label
	destroy .key.botbox.passwd
	destroy .key.botbox.btn
	destroy .key.botbox
	destroy .key
}
